<template>
  <el-dialog
    title="批量管理策略"
    :visible.sync="dialogShbetVisible"
    width="40%"
    :before-close="handleClose"
  >
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="活动名称">
        <el-select
          v-model="form.region"
          placeholder="请选择"
          style="width: 450px"
        >
          <el-option
            v-for="item in policyName"
            :key="item.createTime"
            :label="item.policyName"
            :value="item.policyName"
          /> </el-select
      ></el-form-item>
      <el-form-item>
        <el-row>
          <el-button style="margin-left: 50px" @click="handleClose"
            >取消</el-button
          >
          <el-button type="warning" style="margin-left: 40px" @click="yingyong">确认</el-button>
        </el-row>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import { getStrategy, addStrategy } from '../../../api/devive'
export default {
  name: 'CelueguanLi',
  data () {
    return {
      dialogShbetVisible: false,
      form: {
        region: null
      },
      policyName: []
    }
  },
  methods: {
    // 关闭弹窗
    handleClose () {
      this.form.region = null
      this.dialogShbetVisible = false
    },
    // 获取策略列表
    async strategy () {
      const data = await getStrategy()
      console.log(data, 9898)
      this.policyName = data.data
    },
    // 应用策略
    async yingyong () {
      try {
        this.$refs.form.validate()
        const data = await addStrategy(this.form)
        console.log(data)
      } catch (error) {
        console.log(error)
      }
    }
  }
}
</script>

<style scoped lang='scss'>
</style>
